<div class = "main-view"><!--最外层div-->
    <div class="left-margin top-margin"><strong class="am-text-primary am-text-lg">雷锋团申请</strong></div>


    <form class="am-form-inline left-margin top-margin" role="form">
        <div class="am-form-group">

            <!--<div class = "city-cascading" style = "display: inline-block;" id = "cascad-search"></div>-->

            <div class="top-margin">
                <label class="left-margin">审核状态:</label>
                <select ng-model="status">
                    <option value=''>-- 请选择 --</option>
                    <option value=0>暂未通过</option>
                    <option value=1>已通过</option>
                    <option value=-1>已拒绝</option>
                </select>
                <label class="left-margin">申请人ID:</label> <input type="text" class="am-form-field" ng-model="userId">
                <!--<label class="left-margin">昵称:</label> <input type="text" class="am-form-field" ng-model="nickName">-->
                <label class="left-margin">姓名:</label> <input type="text" class="am-form-field" ng-model="name">
                <label class="left-margin">手机:</label> <input type="text" class="am-form-field" ng-model="mobilePhone">
            </div>

            <!--<div class="top-margin">-->
                <!--<label class="left-margin">申请时间:</label>-->
                <!--<input type="text" id="startDate" class="form-control datepicker" size="12" data-date-format="yyyy-mm-dd">-->
                <!--<label >至:</label>-->
                <!--<input type="text" id="endDate" class="form-control datepicker" size="12" data-date-format="yyyy-mm-dd">-->
            <!--</div>-->

        </div>
        <button type="submit" class="am-btn am-btn-primary" ng-click="search($event)" data-target = "cascad-search">搜索</button>
    </form>
    <br>

    <div id = "pagination" class = "pagination"></div>
    <div class="pagination-table left-margin" id="tab_menu" style = "margin-top: 0px;">
        <form class="am-form">
            <table class="am-table am-table-striped am-table-hover table-main">
                <thead>
                <tr>
                    <th class="table-check"><input type="checkbox" ng-click="allSelected()"></th>
                    <th class="table-title">城市	</th>
                    <th class="table-title">小区	</th>
                    <th class="table-title">昵称	</th>
                    <th class="table-title">申请姓名</th>
                    <th class="table-title">地址</th>
                    <th class="table-title">手机号</th>
                    <th class="table-title">发帖数</th>
                    <th class="table-title">回复数</th>
                    <th class="table-title">点赞数</th>
                    <th class="table-title">发二手</th>
                    <!--<th class="table-title">置顶数</th>-->
                    <!--<th class="table-title">删帖数</th>-->
                    <th class="table-title">邀请人数</th>
                    <!--<th class="table-title">转移帖子数</th>-->
                    <th class="table-title">申请时间</th>
                    <th class="table-title">擅长领域</th>
                    <th class="table-title">详细信息</th>
                    <th class="table-title">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="apply in applyList">
                    <td class="table-check"><input type="checkbox" class="item-check"></td>
                    <td>{{apply.community.city}}</td>
                    <td>{{apply.community.communityName}}</td>
                    <td>{{apply.user.nickName}}</td>
                    <td>{{apply.name}}</td>
                    <td>{{apply.address}}</td>
                    <td>{{apply.phone}}</td>
                    <td>{{apply.questionCount}}</td>
                    <td>{{apply.replyCount}}</td>
                    <td>{{0}}</td>
                    <td>{{0}}</td>
                    <td>{{0}}</td>
                    <!--<td>{{0}}</td>-->
                    <!--<td>{{0}}</td>-->
                    <td>{{apply.dateCreated  | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td>{{apply.specialty}}</td>
                    <td>
                        <div class = "ell" style = "width: 70px;line-height: 1.2;">
                            <a href="javascript:void(0)" id="resModal{{$index}}" ng-click="">查看</a>
                        </div>
                    </td>

                    <td>
                        <button ng-show="apply.status==1" class="am-btn am-btn-default am-btn-xs" > 已通过</button>
                        <button ng-show="apply.status==-1" class="am-btn am-btn-default am-btn-xs" > 已拒绝</button>
                        <button ng-show="apply.status==0" class="am-btn am-btn-default am-btn-xs am-text-secondary" ng-click="handleApply(true, apply)"><span class="am-icon-pencil-square-o"></span> 通过</button>
                        <button ng-show="apply.status==0" class="am-btn am-btn-default am-btn-xs am-text-danger" ng-click="declineShow(apply)" ><span class="am-icon-pencil-square-o"></span> 拒绝</button>

                    </td>

                </tr>
                </tbody>
            </table>
        </form>
    </div>



    <div class="am-modal am-modal-no-btn" id="doc-modal-reject">
        <div class="am-modal-dialog">
            <div class="am-modal-hd border-bottom" style = "text-align: left;">拒绝申请
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div class="am-modal-bd body-area text-left">
                <form>
                    <label>提示信息：</label>
                    <textarea style="width:580px;height:150px;" ng-model="apply.msg"></textarea>
                </form>
            </div>
            <div class = "button-area border-top">
                <button type="button" class="am-btn am-btn-success right-margin top-margin" ng-click="handleApply(false, apply)">确认</button>
            </div>
        </div>
    </div>


    <div class = "left-margin">共<span id = 'page_number'>{{pageNumber}}</span>页 <span>{{count}}条数据</span></div>


</div>


<script>
    Date.prototype.format = function (format) {
        var o = {
            "M+": this.getMonth() + 1, //month
            "d+": this.getDate(), //day
            "h+": this.getHours(), //hour
            "m+": this.getMinutes(), //minute
            "s+": this.getSeconds(), //second
            "q+": Math.floor((this.getMonth() + 3) / 3), //quarter
            "S": this.getMilliseconds() //millisecond
        }
        if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
                (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o) if (new RegExp("(" + k + ")").test(format))
            format = format.replace(RegExp.$1,
                    RegExp.$1.length == 1 ? o[k] :
                            ("00" + o[k]).substr(("" + o[k]).length));
        return format;
    }

    var fromDate = $('#startDate').datepicker().on('changeDate', function (ev) {
        //alert(ev.date.format('yyyy-MM-dd'));
        //$scope.startDate=ev.date.format('yyyy-MM-dd');
        $("#startDate").val(ev.date.format('yyyy-MM-dd'));
//        alert(ev.date);
    });

    var toDate = $('#endDate').datepicker().on('changeDate', function (ev) {
        // alert(ev.date.format('yyyy-MM-dd'));
        //$scope.endDate=ev.date.format('yyyy-MM-dd');
        $("#endDate").val(ev.date.format('yyyy-MM-dd'));
    });

    var hideContent = function(obj){
        $("#display_hide_content").css("display","block");
        $("#display_hide_content1").text(obj.innerText);
        $("#display_hide_content")[0].style.left = obj.offsetLeft + "px";
        $("#display_hide_content")[0].style.top = 60 + obj.offsetTop + "px";
    };

    $("#display_hide_close").on("click",function(){
        $("#display_hide_content").css("display","none");
    });

</script>